require.config({
    baseUrl:"./modules_ItemDetails",
    paths:{
        jq:"../libs/jquery",
        getData:"../modules_productList/getData",
        setLocal:"./setLocal",
        LoginGuard:"../modules_productList/LoginGuard"
    }
})
require(["jq","getData","setLocal","LoginGuard"],function(_,getData,setLocal,LoginGuard){
    // 登录守卫
    const nav_span = document.querySelector(".nav_span");
    LoginGuard(nav_span)
    // 渲染页面
    const join = document.querySelector(".join");
    const id = location.search.split("=")[1];
    getData(res=>{
        let i = 0;
        res.some((val,idx)=>{
            i = idx;
            return val.proId === id;
        })
        join.addEventListener("click",()=>{
            setLocal(res[i].proId, res[i].price);
        })
    })
})